<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%String ctx = request.getContextPath(); %>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>

<script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/validators/news.js"></script>

<script type="text/javascript">
  var attSize = parseInt('<s:property value="news.attachJSON.size()"/>');
</script>

 <div class="f_l margin1" style="width:100%">
    <div style="height:24px;color:red" align="center" id="errorInfo">${failInfo }</div>
   	<div style="height:24px;color:red;font-weight:bold" align="left">修改新闻</div>
    <s:form enctype="multipart/form-data" id="submitForm" action="news!update" method="post" theme="simple">
   	<table>
   		<tbody>
   			<tr>
   				<td width="10%"><s:text name="新闻标题"/>：</td>
   				<td><input type="text" name="news.title" value="${news.title}"/></td>
   			</tr>
   			<tr>
   				<td valign="middle"><s:text name="标题图片"/>：</td>
   				<td>
   				    <s:iterator value="news.attachJSON" var="pic">
	   					<div><s:property value='#pic.get("attName")'/>&nbsp;<a onclick="javascript:deleteAttAndSize(this,'<s:property value="#pic.get('attId')" />','submitForm','news')" href="javascript:void(0);"  style="color:red">删除</a></div>
	   			    </s:iterator>
	   				<a href="javascript:void(0)" onclick="updateAttachment(this,'news')">添加图片</a>
   				</td>
   			</tr>
   			<tr>
   				<td><s:text name="新闻类别"/>：</td>
   				<td>
   					<select name="news.type">
   				      <option <s:if test="%{news.type == 1}">selected="selected"</s:if> value="1">-- 公司新闻 --</option>
   				      <option <s:if test="%{news.type == 2}">selected="selected"</s:if> value="2">-- 行业动态 --</option>
   				    </select>  
   				</td>
   			</tr>
   			<tr>
   			    <td><s:text name="新闻简述"/>：</td>
   				<td><textarea rows="4" cols="50" name="news.brief">${news.brief}</textarea></td>
   			</tr>
   			<tr>
   				<td><s:text name="新闻正文"/>：
   				</td><td><textarea rows="8" cols="50" name="news.content">${news.content}</textarea></td>
   			</tr>
   			<tr> 
   				<td align="left">
   					<input type="submit" value="确认" onclick="return doValidate(event);" />
  				</td>
   				<td align="left">
   					<input type="button" value="取消" onclick="javascript:history.back(-1);"/>
   				</td>
   			 </tr>
   		</tbody>
   	</table>
   	<input type="hidden" id="news.id" name="news.id" value="${news.id}">
   	<input type="hidden" id="news.publisherId" name="news.publisherId" value="${news.publisherId}">
   	<input type="hidden" id="news.publisherName" name="news.publisherName" value="${news.publisherName}">
   	
    </s:form>
    <ckeditor:replace replace="news.content" basePath="../ckeditor" />
  </div>
  